#region (c) 2014 THN Solutions LLC. - All rights reserved
/*
Simplified BSD License (BSD)
Copyright (c) 2014, THN Solutions LLC. ( www.ThnSolutions.com )
Author: Nguyễn, M. Hải                 ( www.Minh-Hai.com     )
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

    * Redistributions of source code must retain the above copyright notice, this 
      list of conditions and the following disclaimer.

    * Redistributions in binary form must reproduce the above copyright notice, 
      this list of conditions and the following disclaimer in the documentation 
      and/or other materials provided with the distribution.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND 
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED 
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. 
IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT,
INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, 
BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA,
OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE 
POSSIBILITY OF SUCH DAMAGE.
*/
#endregion

#region Record of Change
//             							CHANGE HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | DEVELOPER  | DESCRIPTION                                              |
// -------------------------------------------------------------------------------------
// | 09-Nov-09 | HaiNM      | First creation.                                          |
// -------------------------------------------------------------------------------------
//
#endregion

#region Record of Audit
//             							REVIEW HISTORY
// -------------------------------------------------------------------------------------
// |   DATE    | REVIEWER   | NOTES                                                    |
// -------------------------------------------------------------------------------------
// -------------------------------------------------------------------------------------
//
#endregion

#region Using directives
using System;
using System.Drawing;

using Thn;
#endregion

namespace Thn.Interface.Vcl
{
    /// <summary>
    /// Base class for edit box's rendering context.
    /// </summary>
#if DEBUG
    public
#else
    public
#endif
    class EditBoxRenderContext : RenderContext
    {
        #region Fields
        #endregion

        #region Properties

        #region Icon
        private Image mIcon;
        /// <summary>
        /// Gets/Sets Icon
        /// </summary>
        public Image Icon
        {
            get { return mIcon; }
            set { mIcon = value; }
        }
        #endregion

        #region Control Region
        private Rectangle mControlRegion;
        /// <summary>
        /// Gets/Sets region of the whole control.
        /// </summary>
        public Rectangle ControlRegion
        {
            get { return mControlRegion; }
            set { mControlRegion = value; }
        }
        #endregion

        #region Title Region
        private Rectangle mTitleRegion;
        /// <summary>
        /// Gets/Sets region of the title.
        /// </summary>
        public Rectangle TitleRegion
        {
            get { return mTitleRegion; }
            set { mTitleRegion = value; }
        }
        #endregion

        #region Edit Region
        private Rectangle mEditRegion;
        /// <summary>
        /// Gets/Sets editing region (button + text + icon).
        /// </summary>
        public Rectangle EditRegion
        {
            get { return mEditRegion; }
            set { mEditRegion = value; }
        }
        #endregion

        #region Text Region
        private Rectangle mTextRegion;
        /// <summary>
        /// Gets/Sets region for rendering text.
        /// </summary>
        public Rectangle TextRegion
        {
            get { return mTextRegion; }
            set { mTextRegion = value; }
        }
        #endregion

        #region Button Region
        private Rectangle mButtonRegion;
        /// <summary>
        /// Gets/Sets region for rendering button (if available).
        /// </summary>
        public Rectangle ButtonRegion
        {
            get { return mButtonRegion; }
            set { mButtonRegion = value; }
        }
        #endregion

        #region Icon Region
        private Rectangle mIconRegion;
        /// <summary>
        /// Gets/Sets region for rendering icon (if available).
        /// </summary>
        public Rectangle IconRegion
        {
            get { return mIconRegion; }
            set { mIconRegion = value; }
        }
        #endregion

        #region Display Text
        private string mDisplayText = "";
        /// <summary>
        /// Gets/Sets the text to be renderered.
        /// </summary>
        public string DisplayText
        {
            get { return mDisplayText; }
            set { mDisplayText = value; }
        }
        #endregion        

        #region Alignment
        private ContentAlignment mAlignment = ContentAlignment.MiddleRight;
        /// <summary>
        /// Gets or Sets alignment of text
        /// </summary>
        public ContentAlignment Alignment
        {
            get { return mAlignment; }
            set
            {
                if (mAlignment != value)
                {
                    mAlignment = value;
                }
            }
        }
        #endregion

        #region Multiline
        private bool mMultiline = false;
        /// <summary>
        /// Gets/Sets whether long text shall be rendered as multiple rows.
        /// </summary>
        public bool Multiline
        {
            get { return mMultiline; }
            set
            {
                mMultiline = value;
            }
        }
        #endregion

        #region Is Mouse Over
        private bool mIsMouseOver;
        /// <summary>
        /// Gets/Sets whether mouse is within this control's boundary.
        /// </summary>
        public bool IsMouseOver
        {
            get { return mIsMouseOver; }
            set { mIsMouseOver = value; }
        }
        #endregion

        #region Text Style
        private TextStyle mTextStyle = TextStyle.Normal;
        /// <summary>
        /// Gets/Sets style of text.
        /// </summary>
        public TextStyle TextStyle
        {
            get { return mTextStyle; }
            set { mTextStyle = value; }
        }
        #endregion

        #region Drop Button State
        private ButtonState mDropButtonState = ButtonState.Normal;
        /// <summary>
        /// Gets or Sets state of drop button.
        /// </summary>
        public ButtonState DropButtonState
        {
            get { return mDropButtonState; }
            set { mDropButtonState = value; }
        }
        #endregion  

        #endregion

        #region Constructors
        /// <summary>
        /// Default constructor.
        /// </summary>
        public EditBoxRenderContext()
        { }
        #endregion
    }
}
